import 'package:f_demo_one/components/16_shopList.dart';
import 'package:flutter/material.dart';

class MyApp16 extends StatelessWidget {
  const MyApp16({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      //导航条
      appBar: AppBar(
        title: const Text(
          'ListViewBuilder',
          style: TextStyle(color: Colors.white, fontSize: 20),
        ),
        backgroundColor: Colors.pink,
        centerTitle: true,
      ),
      //主体区域
      body: ListView.separated(
        //列表的每一项
        itemBuilder: (BuildContext context, int index) {
          return ShopList();
        },
        separatorBuilder: (BuildContext context, int index) {
          return Container(
            //
            height: 1,
            color: Colors.red,
            margin: const EdgeInsets.only(left: 10, right: 10),
            // child: const Divider(height: 1),
          );
        },
        itemCount: 20,
      ),
    );
  }
}
